import numpy as np

a = np.array([[2,10,20],[80,43,31],[22,43,10]])

print("初始化数组的值:",a)
print("设置沿着水平方向求值:",np.ptp(a,axis=1))
print("设置沿着垂直方向求值:",np.ptp(a,axis=0))